﻿using System.Globalization;
using System.Threading;
using System.Web.Mvc;
using Website.Interfaces;
using Website.Models;

namespace Website.Controllers
{
    public class HomeController : Controller
    {
        private IArtCollection _artCollection;
        private SiteDefinition _siteDefinition;

        public HomeController(IArtCollection artCollection, ISiteDefinitionManager siteDefinitionManager)
        {
            _artCollection = artCollection;
            _siteDefinition = siteDefinitionManager.SiteDefinitions;
        }

        public ActionResult Index()
        {
            ViewBag.Welcome = "active";
            ViewBag.frontimage = _siteDefinition.FrontPageImage;
            return View();
        }

        public ActionResult About()
        {
            ViewBag.About = "active";
            var about = _siteDefinition.AboutPage;
            return View(about);
        }

        public ActionResult Paintings()
        {
            ViewBag.Paintings = "active";
            var paintings = _artCollection.Paintings;
            return View(paintings);
        }

        public ActionResult Links()
        {
            ViewBag.Links = "active";
            var links = _siteDefinition.Links;
            return View(links);
        }

    }
}
